home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / nt / emacssrc.zip / EMACSSRC.TAR / emacs-19.17 / vms / development.notes < prev    next >
Text File  |  1992-11-06  |  4KB  |  140 lines

  1. I hate to sound ungrateful, but....
  2.  
  3. Somewhere between version 18 and version 19 someone has hacked on the
  4. VMS sections of the code.  And it looks like they didn't finish.  Most
  5. of the problems I've found are minor, however, I've run into some that
  6. are leaving me puzzled.
  7.  
  8. ================
  9. In sysdep.c:
  10.  
  11. There is a small piece of code in sysdep.c that refers to undeclared
  12. variables.  It is not commented, and it is not in 18.58.  I have no idea
  13. what it is supposed to be doing, so for now I've commented it out.  This
  14. gets sysdep.c to compile, with a few warning messages.  Here's the
  15. function with the code:
  16.  
  17. kbd_input_ast ()
  18. {
  19.   register int c = -1;
  20.   int old_errno = errno;
  21.   extern EMACS_TIME *input_available_clear_time;
  22.  
  23.   if (waiting_for_ast)
  24.     SYS$SETEF (input_ef);
  25.   waiting_for_ast = 0;
  26.   input_count++;
  27. #ifdef ASTDEBUG
  28.   if (input_count == 25)
  29.     exit (1);
  30.   printf ("Ast # %d,", input_count);
  31.   printf (" iosb = %x, %x, %x, %x",
  32.       input_iosb.offset, input_iosb.status, input_iosb.termlen,
  33.       input_iosb.term);
  34. #endif
  35.   if (input_iosb.offset)
  36.     {
  37.       c = input_buffer;
  38. #ifdef ASTDEBUG
  39.       printf (", char = 0%o", c);
  40. #endif
  41.     }
  42. #ifdef ASTDEBUG
  43.   printf ("\n");
  44.   fflush (stdout);
  45.   sleep (1);
  46. #endif
  47.   if (! stop_input)
  48.     queue_kbd_input ();
  49. /* I don't know what this is doing!  The variables buf, cbuf and i are
  50.    not declared.  This is new from version 18, what does it do?
  51.   if (c >= 0)
  52.     {
  53.       struct input_event e;
  54.       e.kind = ascii_keystroke;
  55.       XSET (buf[i].code, Lisp_Int, cbuf[i]);
  56.       e.frame = selected_frame;
  57.       kbd_buffer_store_event (&e);
  58.     }
  59. */
  60.   if (input_available_clear_time)
  61.     EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0);
  62.   errno = old_errno;
  63. }
  64.  
  65. So the question is, who put it in and why?
  66.  
  67.  
  68. ================
  69. In regex.c:
  70.  
  71. I can't figure out what VAXC hates about the macros EXTRACT_NUMBER and
  72. EXTRACT_NUMBER_AND_INCR.  Here is a typical error
  73.  
  74.     Compiling REGEX...
  75.               EXTRACT_NUMBER_AND_INCR (j, p);
  76.     %CC-W-REPLACED, Replaced reserved word "char" with ")".
  77.             Listing line number 5925.
  78.             At line number 2658 in GNU:[EMACS19.SRC]REGEX.C;1.
  79.  
  80.               EXTRACT_NUMBER_AND_INCR (j, p);
  81.     %CC-E-SYNTAXERROR, Found ")" when expecting
  82.             one of { "," ";" }.
  83.             Listing line number 5925.
  84.             At line number 2658 in GNU:[EMACS19.SRC]REGEX.C;1.
  85.  
  86.               EXTRACT_NUMBER_AND_INCR (j, p);
  87.  
  88. And here is the actual source line(s)
  89.  
  90.     case jump:
  91.         case jump_past_alt:
  92.     case dummy_failure_jump:
  93.           EXTRACT_NUMBER_AND_INCR (j, p);
  94.       p += j;    
  95.       if (j > 0)
  96.         continue;
  97.             
  98. The macro definition looks fine to me, and the expansion is okay.  This
  99. looks to me like a bug in VAX C.  The stuff below is from the listing
  100. produced by the compiler (formatted pretty for readability).
  101.  
  102.     EXTRACT_NUMBER_AND_INCR (j, p); 
  103.     1    do { 
  104.         EXTRACT_NUMBER (j, p);
  105.         (p) += 2;
  106.     } while (0);
  107.     2   do {
  108.         do {
  109.         (j) = *(p) & 0377;
  110.         (j) += SIGN_EXTEND_CHAR (*((p) + 1)) << 8;
  111.         } while (0);
  112.         (p) += 2;
  113.     } while (0);
  114.     3   do {
  115.         do {
  116.         (j) = *(p) & 0377; 
  117.         (j) += ((signed char) (*((p) + 1))) << 8; 
  118.         } while (0);
  119.         (p) += 2;
  120.     } while (0);
  121.  
  122. It seems to be at this third level of expansion that the compiler barfs.
  123. It replaces the (valid) reserved word `char' with a ')' which is
  124. horribly wrong.  It screws up the cast.
  125.  
  126. ================
  127. In vmsproc.c
  128.  
  129. The function call_process_cleanup is missing.  For the time being, I've
  130. lifted the version from process.c.  It will probably cause Emacs to
  131. crash the first time it is called, but will serve for now.
  132.  
  133. The macros DCL_PROMPT, INTERACTIVE, RUNNING, EXITTED, and CHANGED are
  134. not defined.  I defined them in vmsproc.h as "$" for DCL_PROMPT, with
  135. the rest as integers, which is probably wrong.
  136.  
  137. Vprocess_alist is referenced, but it is not at all clear to me that this
  138. is what should be being used here.  I don't understand the ideas behind
  139. how this was to be run in the first place....
  140.